package study;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;

/**
 * @author mayn
 */
public class DateTest {
    public static void main(String[] args) {

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());					//放入Date类型数据

        System.out.println("当前年："+calendar.get(Calendar.YEAR));
        System.out.println("当前月："+calendar.get(Calendar.MONTH));
        System.out.println("当前日："+calendar.get(Calendar.DATE));
        calendar.get(Calendar.HOUR);
        calendar.get(Calendar.HOUR_OF_DAY);
        calendar.get(Calendar.MINUTE);
        calendar.get(Calendar.SECOND);
    }
}
